<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>FormLayout 表单布局</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    
    <script src="__PUBLIC__/scripts/boot.js" type="text/javascript"></script>
    
    
    <style type="text/css">
        
       
    </style>

</head>
<body>
    <h1>发送信件</h1>      
  
<div id="form1">  
	
<table class="form-table" border="0" cellpadding="1" cellspacing="2">
    <tr>
        <td class="form-label" style="width:60px;">收件人：</td>
        <td style="width:100px">
            	<input id="getname" name="getname" class="mini-textboxlist" required="true" style="width:400px;"
    		valueField="text" textField="text" url="__APP__/Filter/username"  text="{$defultmail["getname"]}" />
			
        </td>
    </tr>
    <tr>
        <td class="form-label" style="width:60px;">主题：</td>
        <td >
            <input name="title" class="mini-textbox" value="{$defultmail["title"]}" style="width:400px"/>
        </td>
    </tr>
    <tr>
        <td class="form-label">内容：</td>
        <td>
            <input name="content" class="mini-textarea" style="width:500px;height:300px" />
        </td>
    </tr>
	<tr>
	<td>
         <input value="发送" type="button" onclick="submitForm()" />		 
	</td>
	<td>
		<input value="重置" type="button" onclick="resetForm()"/>
	</td>
	</tr>
</table>
</div>

    
    <script type="text/javascript">
        mini.parse();
		
         function submitForm() {
			//提交表单数据
            var form = new mini.Form("#form1");            
            var data = form.getData();
			var getname=mini.get("getname");
			data["getname"]=getname.getValue();				
            //var json = mini.encode(data);   //序列化成JSON
            $.ajax({
                url: "__APP__/Mail/send",
                type: "post",
                data: { Data: data },
                success: function (text) {
                    alert("提交成功");
                }
            });

        }
		function getForm() {
			//提交表单数据
            var form = new mini.Form("#form1");  
            form.validate();
            if (form.isValid() == false) return;
			
            var data = form.getData(true);
			var getname=mini.get("getname");
			data["getname"]=getname.getValue();		//获取表单多个控件的数据
            var json = mini.encode(data);   //序列化成JSON			
			mini.alert(json);
        }
		  function resetForm() {
            var form = new mini.Form("#form1");
            form.reset();
        }
	function CloseWindow(action) {

        if (window.CloseOwnerWindow) window.CloseOwnerWindow(action);

        else window.close();

    	}
    </script>

    
</body>
</html>